package com.tong.hao.zuul;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HaoZuulApplication
 * @Author 友野浩二
 * @Date 2019/11/7 22:42
 * @Description zuul API网关
 *
 * <pre>
 *     @EnableZuulProxy : 声明一个zuul代理。
 * </pre>
 */
@SpringBootApplication
@EnableZuulProxy
@EnableDiscoveryClient
@RestController
@RequestMapping(value = "tongzuul")
@Slf4j
public class HaoZuulApplication {

    public static void main(String[] args) {
        SpringApplication.run(HaoZuulApplication.class, args);
        log.info("<<<<======== Tong Zuul started ========>>>>");
    }

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String home() {
        return "This is Tong zuul!";
    }

}
